﻿namespace CoreEx.Common.Validation
{
    /// <summary>
    /// Represents a class that is capable of validating a target instance. 
    /// </summary>
    /// <typeparam name="T">The target type to validate.</typeparam>
    public interface IValidator<T>
    {
        /// <summary>
        /// Validates the <paramref name="target"/> instance.
        /// </summary>
        /// <param name="target">The target instance to validate.</param>
        /// <returns>A <see cref="string"/> that contains a textual representation of the broken rule, if any.</returns>
        string Validate(T target);
    }
}
